This page is about trend in personal consumption in the US

TODO:

Change colors;

Add description.

Import data

consumption_product = readxl::read_excel("data/consumption_product.xlsx") %>% 
  janitor::clean_names() %>% 
  pivot_longer(
    x2019_q1 : x2021_q3,
    names_to = "time",
    names_prefix = "x",
    values_to = "consumption"
  ) 

consumption_function = readxl::read_excel("./data/consumption_function.xlsx") %>% 
  janitor::clean_names() %>% 
  filter(as.numeric(line) <= 28) %>% 
    pivot_longer(
    x2019_q1 : x2021_q3,
    names_to = "time",
    names_prefix = "x",
    values_to = "consumption"
  ) %>% 
  mutate(functions = recode(functions, `Household consumption expenditures (for services)` = "household",
                           `Final consumption expenditures of nonprofit institutions serving households (NPISHs)1` = "nonprofit consumption"))

general_1 = consumption_function %>% 
  filter(functions %in% c("Goods","Services"))

covid_seasonal = read_csv("covid_seasonal.csv") %>% 
  rename(time = date) %>% 
  select(time, quarterly)

consumption_seasonal = general_1 %>% 
  select(-line)

covid_consumption = left_join(consumption_seasonal, covid_seasonal, by = "time")

Consumption and Covid

joint_plot = plot_ly(covid_consumption, x = ~time) %>% 
  add_trace(y = ~consumption, type = "scatter", mode = "lines", color = ~functions, yaixs = "y") %>% 
  add_trace(y = ~quarterly, type = "bar", name = "Covid Cases", yaxis = "y2")  %>% 
  layout(title = "Consumption of Goods and Services Compared with Covid Cases",
         yaxis=list(title = "consumption expenditure", side="left"),
         yaxis2=list(title = "covid cases", side="right",overlaying="y"),
         showlegend=TRUE)

joint_plot

The lowest point actually did not happen as expected at the peak of the pandemic. In the second quarter of 2020, when cases start to rise, personal protective equipment were in a shortage, no effective treatment plans/vaccines are available, the total expenditure of consumption in the US reached to its lowest.

Consumption expenditures of services experienced a steeper change than expenditures of goods due to the shutdown of businesses, the quarantine and the lock down policies etc.

Even though cases keep rising, as

The total consumption expenditure is even larger by now comparing with that before the pandemic. This can be partially explained by inflation and government’s stimulus plan.

Consumption of Goods

general_2 = consumption_function %>% 
  filter(functions %in% c("Durable goods","Nondurable goods","household","nonprofit consumption")) %>% 
  select(-line) %>% 
  pivot_wider(names_from = functions, values_from = consumption) %>% 
  janitor::clean_names()

subfig_1 = plot_ly(general_2, x = ~time, y = ~durable_goods, type = "bar", name = "Durable Goods") %>% 
  add_trace(y = ~nondurable_goods, name = "Nondurable Goods") %>% 
  layout(title = "Decomposition of Consumption of Goods",
         yaxis = list(title = "Consumption"), barmode = "stack",
         legend = list(orientation = 'h', x = 0, y = -0.2))

subfig_1

The proportion of the nondurable goods such as food, drinks and clothing etc. increased after the second quarter of 2020, the time when the cases are rising. This indicates that people are more willing to spend income on the nonduarble goods instead of spending them on buying the durable goods such as cars and house.

This might result from the work-from-home policy which many companies are still keeping even after the outbreak of COVID-19. For example, people need to prepare food for themselves since many of the restaurants are no longer serving, and they don’t need to drive that much so many of them don’t buy the new cars as frequent as they used to.

Durable Goods

durable_goods = 
  consumption_function %>% 
  filter(functions %in% c("Motor vehicles and parts","Furnishings and durable household equipment","Recreational goods and vehicles","Other durable goods")) 

durable_goods %>% 
  plot_ly(x = ~time, y = ~consumption, type = 'scatter', mode = 'lines', yaxis="y", color = ~functions) %>% 
  layout(title = "Decomposition of Consumption in Durable Goods",
         legend = list(orientation = 'h', x = 0, y = -0.2))

Nondurable Goods

nondurable_goods = 
  consumption_function %>% 
  filter(functions %in% c("Food and beverages purchased for off-premises consumption","Clothing and footwear","Gasoline and other energy goods","Other nondurable goods")) 

nondurable_goods %>% 
  plot_ly(x = ~time, y = ~consumption, type = 'scatter', mode = 'lines', yaxis="y", color = ~functions) %>% 
  layout(title = "Decompostion of Consumption in Nondurable Goods",
         legend = list(orientation = 'h', x = 0, y = -0.2))

There is a lowest point of the value of consumption expenditure in all kind of goods consumption in the second quarter of 2020, when the COVID-19 outbroke, and after that, the consumption gradually grow up. From the lowest point we can infer that people were influenced a lot because of the pandemic, many of them might have lost their job in this period, so they don’t have enough money to consume as what they did before.

Motor vehicles and parts increases fastest after the trough, from which we can infer that people go out even more frequently after the pandemic than before the pandemic. We can call it revenge travel, which means people will become more willing to get out of the room after being trapped at home for a long time due to the pandemic, this could also help to explain why there is a consumption trough in the second quarter in 2020 in Gasoline and other energy goods.

Furnishngs and durable household equipment was reduced in the pandemic but not as much as Motor vehicles and parts. That’s because many people lost their jobs and didn’t have enough income to buy new furnishing and other durable equipment that they already have. Moreover, many of the furnising stores shut down in the pandemic.

Recrational goods and vehicles(which mainly include goods for fun such as pc games) increased in the pandemic because spending more time at home without seeing their friends make people spent more time on playing computer games, which will make them more willing to pay for these online games in order to make themselves less lonely.

Clothing and foodwear consumption reduces rapidly in the pandemic because people began to work from home, and didn’t need to go outside to meet other people. So they could just stay in their own room wearing the slippers and pajamas, didn’t need to buy that much new clothes and shoes.

There is a little peak in the second quarter in 2020 on the trend of food and beverages consumption. We can infer that people spent more time and money on buying food and ate more since they spent more time at home and could only make food by themselves.

Consumption of Services

subfig_2 = plot_ly(general_2, x = ~time, y = ~household, type = "bar", name = "Household", colors = "Dark2") %>% 
  add_trace(y = ~nonprofit_consumption, name = "Nonprofit Consumption", colors = "Dark2") %>% 
  layout(title = "Decomposition of Consumption in Services ",
         yaixs = list(title = "Consumption"), barmode = "stack",
         legend = list(orientation = 'h', x = 0, y = -0.2))

subfig_2

Household Services

household_consumption =
  consumption_function %>% 
  filter(functions %in% c("Housing and utilities","Health care","Transportation services","Recreation services","Food services and accommodations","Financial services and insurance","Other services")) 

household_consumption %>% 
  plot_ly(x = ~time, y = ~consumption, type = 'scatter', mode = 'lines', yaxis="y", color = ~functions) %>% 
  layout(title = "Decomposition of Consumption in Household Services",
         legend = list(orientation = 'h', x = 0, y = -0.2))

There is a trough in all kinds of housing service except housing and utilities and finantial service and insurance.

Because of the covid, the hospital didn’t have enough ability to cure all of the patients, and also, most of US people need to work at home, which kept many people away from the hospital–there are not enough doctors and space for new patients, and those who work at home are less likely to get the illness such as cold.

Transpotation service includes motor vehicle repair fee, leasing fee and rental fee and fees for public transform. So these fee rapidly reduced in the pandemic, since people didn’t need to go out and use the transportation.

Food service and accommodations reduced because most of the restaurant shut down in the pandemic. And people also don’t need to eat outside because they work from home without going to the office and school.

Recration service mainly includes the fees of the activities for fun such as sport, museum, gambling, package tour etc. Most of these activities need to be completed outdoor, which was impossible in the pandemic.

Only the housing and utilities(which mainly includes housing rental and the fees for the resouces at home such as electricity and gas) and finantial service and insurance (which mainly includes life and health insurance anc commissions in banks) were not reduced in the pandemic and even slowly increased because people spend most of their time at home, and was impossible to use less life basic resource. And also, most of the service in the banks can be completed online now, so paying for the insurance and the commission was not influenced a lot in the pandemic.

Consumption Structure Analysis

durable_goods_radar = durable_goods %>% 
  filter(time %in% c("2019_q1", "2021_q3")) %>% 
  select(functions, time, consumption)  %>% 
  pivot_wider(names_from = functions, values_from = consumption) 

total = rep(1,5)
start = rep(0,5)
durable_goods_radar = rbind(total, start, durable_goods_radar)[,-1]
rownames(durable_goods_radar) = c("1", "2", "2019_q1", "2021_q3")
colnames(durable_goods_radar) = c("motor", "furnishing", "recreation", "other")
durable_goods_radar[3,] = durable_goods_radar[3,]/1473292
durable_goods_radar[4,] = durable_goods_radar[4,]/1984391

durable_goods_radar[-c(1,2),] %>% 
  knitr::kable()
motor furnishing recreation other
0.3394256 0.2387931 0.2761163 0.1456649
0.3303764 0.2366091 0.2889768 0.1440371
radar_1 = radarchart(durable_goods_radar) 

nondurable_goods_radar = nondurable_goods %>% 
  filter(time %in% c("2019_q1", "2021_q3")) %>% 
  select(functions, time, consumption)  %>% 
  pivot_wider(names_from = functions, values_from = consumption) 

nondurable_goods_radar = rbind(total, start, nondurable_goods_radar)[,-1]
rownames(nondurable_goods_radar) = c("1", "2", "2019_q1", "2021_q3")
colnames(nondurable_goods_radar) = c("food/beverage", "clothing", "energy", "other")
nondurable_goods_radar[3,] = nondurable_goods_radar[3,]/2909515
nondurable_goods_radar[4,] = nondurable_goods_radar[4,]/3509766

nondurable_goods_radar[-c(1,2),] %>% 
  knitr::kable()
food/beverage clothing energy other
0.3483196 0.1351971 0.1113089 0.4051741
0.3551200 0.1367587 0.1078300 0.4002914
radar_2 = radarchart(nondurable_goods_radar)

household_consumption_radar = household_consumption %>% 
  filter(time %in% c("2019_q1", "2021_q3")) %>% 
  select(functions, time, consumption)  %>% 
  pivot_wider(names_from = functions, values_from = consumption) 

total = rep(1,8)
start = rep(0,8)
household_consumption_radar = rbind(total, start, household_consumption_radar)[,-1]
rownames(household_consumption_radar) = c("1", "2", "2019_q1", "2021_q3")
colnames(household_consumption_radar) = c("housing", "healthcare", "transports", "recreation", "accomodation", "finance", "other")
household_consumption_radar[3,] = household_consumption_radar[3,]/9336650
household_consumption_radar[4,] = household_consumption_radar[4,]/9984527

household_consumption_radar[-c(1,2),] %>% 
  knitr::kable()
housing healthcare transports recreation accomodation finance other
0.2714813 0.2579861 0.0513708 0.0614477 0.1057028 0.1238437 0.1281675
0.2793373 0.2583677 0.0461719 0.0516284 0.1083851 0.1279287 0.1281807
radar_3 = radarchart(household_consumption_radar)